package Eyjafjalla.action;

import Eyjafjalla.helper.EyjafjallaHelper;
import Eyjafjalla.patch.CloudPatch;
import com.megacrit.cardcrawl.actions.AbstractGameAction;
import com.megacrit.cardcrawl.actions.common.DrawCardAction;
import com.megacrit.cardcrawl.actions.common.GainBlockAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;

public class DreamCradleAction extends AbstractGameAction {
    public DreamCradleAction(int amount) {
        this.amount = amount;
    }

    @Override
    public void update() {
        if (DrawCardAction.drawnCards.size() > 0) {
            for (AbstractCard c : DrawCardAction.drawnCards) {
                if(CloudPatch.CloudField.isFire.get(c))
                    addToTop(new GainBlockAction(AbstractDungeon.player,this.amount));
                else
                    EyjafjallaHelper.markCardToFire(c, 1);
            }
        }

        this.isDone = true;
    }
}


